
def SplitLocale(locale):
    locale = locale.split('-')
    l = len(locale)
    return (
        l and locale[0].lower() or u'',
        l > 1 and locale[1].upper() or u'',
    )

def JoinLocale(lang, region):
    return lang.lower() + '-' + region.upper()